home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Dr. Windows 3
/
dr win3.zip
/
dr win3
/
DATABASE
/
MSADDL11.ZIP
/
MSADDL11.TXT
< prev
next >
Wrap
Text File
|
1993-06-17
|
49KB
|
937 lines
****************************************************************************
----------------------------------------------------------------------------
| IMPORTANT - PLEASE READ
----------------------------------------------------------------------------
|
| You have a royalty-free right to use, modify, reproduce and distribute
| the software found in these sample files provided, however, that: (a)
| you agree that the MS software is PROVIDED "AS IS" WITHOUT
| WARRANTY OF ANY KIND and in no event shall MS be liable for
| any damages whatsoever in connection with your use of the software;
| and (b) the utilities are redististributed solely in conjunction with and
| as part of your software application.
|
| Copyright 1993 Microsoft Corporation. All Rights Reserved.
| Microsoft and MS-DOS are registered trademarks and Microsoft Access and
| Windows are trademarks of Microsoft Corporation.
****************************************************************************
OVERVIEW
--------
The Microsoft Access Data Definition Language Dynamic Link Library
(MSADDL11.DLL) provides data definition support beyond that provided by
standard Microsoft Access.
GOALS
-----
To enable the Access Basic programmer to create and alter tables, fields,
indexes, and relationships, and then use those tables in Microsoft Access
and Access Basic.
CAUTIONS
--------
This Utility is provided specifically as an aid to developers who need
additional data definition information not provided in the Microsoft
Access retail documentation. As with any DLL, passing an incorrect
argument type or value could result in General Protection Fault (GPF)
errors. If this happens, carefully check your arguments. This Utility
includes an include file (MSA_DDL.TXT) that you can use to declare these
functions. This Utility is not supported by Microsoft; as such, you
should save your work-in-progress frequently to avoid loss of data.
****************************************************************************
DESCRIPTION OF THE DATA DEFINITION DDL
--------------------------------------
The Data Definition interface is a Dynamic Link Library (DLL) you can
call from Access Basic. Its purpose is to allow Access Basic programmers
to programatically manipulate table definitions and data relationships.
For example, this DLL lets you create tables via Access Basic code.
(Note: You can use these functions only with Microsoft Access databases
and tables, and not with any other databases or tables.)
Table 1 lists the functions provided by MSADDL11.DLL. Each function is
fully described later in this document.
Table 1. MSADDL11.DLL Functions
----------------------------------------------------------------------
Function Name Purpose
------------------------- --------------------------------------------
AccessDDLStartEngine Initializes Microsoft Access database engine
AccessDDLStopEngine Stops the database engine
AccessDDLOpenDatabase Opens a specified Microsoft Access database
AccessDDLCloseDatabase Closes the database
AccessDDLOpenTable Opens an existing table
AccessDDLCloseTable Closes an open table
AccessDDLCreateTable Creates a new table
AccessDDLDeleteTable Deletes an existing table
AccessDDLRenameTable Renames an existing table
AccessDDLAddField Adds a new field to a table
AccessDDLDeleteField Deletes an existing field
AccessDDLRenameField Renames an existing field
AccessDDLCreateIndex Creates a new index in an existing table
AccessDDLDeleteIndex Deletes an existing index
AccessDDLRenameIndex Renames an existing index
AccessDDLCreateReference Creates a new relationship between tables
AccessDDLDeleteReference Deletes an existing relationship
****************************************************************************
GENERAL DDL PROCEDURE
---------------------
Before you can create, alter, or delete a table, field, index, or
relationship, you must first use the AccessDDLStartEngine function to
initialize the Microsoft Access ISAM database engine. When you are
finished with all DDL operations, use the AccessDDLStopEngine function.
The following figure illustrates this general procedure.
Figure 1. General DDL Procedure
----------------------------------------------------------------------
AccessDDLStartEngine
AccessDDLOpenDatabase
AccessDDLOpenTable
' Perform field, index, and relationship operations.
AccessDDLCloseTable
AccessDDLCreateTable
' Perform field, index, and relationship operations.
AccessDDLCloseTable
AccessDDLCloseDatabase
AccessDDLStopEngine
****************************************************************************
OTHER CONSIDERATIONS
--------------------
The various functions in MSADDL11.DLL don't let you set all of the
properties normally available in MS Access table design (such as
Description and Validation Rule). To set or change these properties, you
must use the regular table design feature of Microsoft Access.
****************************************************************************
FUNCTION DESCRIPTIONS
---------------------
AccessDDLStartEngine Function
Description Performs the initialization required to use the Microsoft
Access ISAM database engine.
Syntax AccessDDLStartEngine(SysDBName, INIFileName, UserName,
Password)
Remarks The AccessDDLStartEngine function uses the following
arguments.
Argument Description
-------------- ------------------------------------------
SysDBName String that identifies the path and name
of the system database file; must be a
valid operating system path; this argument
is ignored when AccessDDLStartEngine is
called from Access Basic, since the path
and name have already been established.
INIFileName String that identifies the path and name
of the INI file; length may not exceed 14
characters; this argument is ignored when
AccessDDLStartEngine is called from Access
Basic, since the path and name have
already been established.
UserName String that is that name of the current
user.
Password String that is the current user's
password.
Returns
----------------------------------------------------------------------
ACCESSDDL_ErrSuccess Operation was successful.
ACCESSDDL_ErrAccessDenied Current user doesn't have required
permissions.
ACCESSDDL_ErrAlreadyInitialized AccessDDLStartEngine already called.
ACCESSDDL_ErrInvalidAccountName Couldn't find account name.
ACCESSDDL_ErrInvalidParameter One or more parameters is invalid or
Null.
ACCESSDDL_ErrInvalidPassword Incorrect or invalid password.
ACCESSDDL_ErrPermissionDenied Invalid DatabaseID argument.
ACCESSDDL_ErrTooManyTasks Too many concurrent DDL instances.
AccessDDLStopEngine Function
Description Stops the Micros